Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add createTheme helper function to enforce proper shape for user themes #18

Merged
merged 2 commits into from
Jul 20, 2020

Conversation

META-DREAMER
Copy link
Contributor

This allows users to enforce their themes to have the same shape as the BaseTheme, but
it retains the types of the users specific values (e.g. what colors the theme has) and also
prevents the loss of typesafety from the { [key:string]: any } in BaseTheme

@JoelBesada
Copy link
Contributor

This is great! Could you update the examples in the readme to use this function as well?

This allows users to enforce their themes to have the same shape as the BaseTheme, but
it retains the types of the users specific values (e.g. what colors the theme has) and also
prevents the loss of typesafety from the `{ [key:string]: any }` in BaseTheme
@META-DREAMER
Copy link
Contributor Author

@JoelBesada done

@JoelBesada
Copy link
Contributor

@HammadJ Thanks!

@JoelBesada JoelBesada merged commit e2bcad2 into Shopify:master Jul 20, 2020
META-DREAMER added a commit to META-DREAMER/restyle that referenced this pull request Jul 22, 2020
…es (Shopify#18)

* Add createTheme helper function to enforce proper shape for user themes

This allows users to enforce their themes to have the same shape as the BaseTheme, but
it retains the types of the users specific values (e.g. what colors the theme has) and also
prevents the loss of typesafety from the `{ [key:string]: any }` in BaseTheme

* Update README with usage of createTheme helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants